package cn.zwx.learn.mybatis.example.croe.session;
/** 
 * 构建工程对象
 * @author zhangwenxue 
 * @date 2022/5/7 21:42
*/ 
public class SqlSessionFactory {

    private Configuration configuration;

    /**
     * build方法用于初始化Configuration，解析配置文件的工作在Configuration的构造函数中
     */
    public SqlSessionFactory build() {
        configuration = new Configuration();
        return this;
    }

    /**
     * 获取DefaultSqlSession
     */
    public DefaultSqlSession openSqlSession(){
        return new DefaultSqlSession(configuration);
    }

}
